package a.f.d;

import a.c.ab;
import a.c.e;
import a.c.k;
import a.c.x;
import a.f.o;
import a.i.nb;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

class lb
  implements fb
{
  private a_ a;
  private fb b;
  private k c;
  private k d;
  private boolean e;
  private Object f;
  
  public void a(fb paramfb, k paramk1, k paramk2, Object paramObject)
  {
    this.b = paramfb;
    this.c = paramk1;
    this.d = paramk2;
    this.f = paramObject;
  }
  
  public int a(o paramo, x paramx, ab paramab)
  {
    int i2 = f.o;
    int i1 = f.n;
    if (i2 == 0)
    {
      if (this.a != null)
      {
        if (i2 != 0) {
          break label187;
        }
        if (!this.e) {
          break label180;
        }
      }
      if (i2 != 0) {}
    }
    else if (this.a == null)
    {
      this.a = new a_();
    }
    int i = this.b.a(paramo, paramx, paramab);
    this.a.a = Math.max(this.a.a, i);
    Object localObject1 = paramo.v();
    e locale;
    Object localObject2;
    do
    {
      do
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        locale = ((a.c.w)localObject1).d();
        localObject2 = c(locale);
        this.a.c.put(localObject2, nb.a(new Integer(paramx.getInt(locale)), this.f));
        ((a.c.w)localObject1).f();
      } while (i1 == 0);
    } while (i2 != 0);
    return i;
    label180:
    label187:
    boolean[] arrayOfBoolean = new boolean[this.a.a];
    localObject1 = paramo.v();
    Object localObject3;
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      locale = ((a.c.w)localObject1).d();
      localObject2 = c(locale);
      localObject3 = (nb)this.a.c.get(localObject2);
      try
      {
        Integer localInteger = (Integer)((nb)localObject3).a;
        if (i2 != 0) {
          break label334;
        }
        int n = localInteger.intValue();
        paramx.a(locale, n);
        if (i1 != 0) {
          break label333;
        }
        arrayOfBoolean[n] = true;
      }
      catch (NullPointerException localNullPointerException)
      {
        throw new IllegalStateException("Memento has no information about " + locale);
      }
      ((a.c.w)localObject1).f();
    } while (i1 == 0);
    label333:
    label334:
    localObject1 = new int[arrayOfBoolean.length];
    int j = 0;
    int k = 0;
    do
    {
      if (k >= localObject1.length) {
        break;
      }
      if (i2 != 0) {
        break label398;
      }
      if (i1 != 0) {
        break label395;
      }
      if (arrayOfBoolean[k] != 0)
      {
        localObject1[k] = j;
        j++;
      }
      k++;
    } while (i1 == 0);
    if (i2 == 0)
    {
      label395:
      if (j < localObject1.length)
      {
        label398:
        a.c.w localw = paramo.v();
        do
        {
          if (!localw.e()) {
            break;
          }
          localObject3 = localw.d();
          int m = paramx.getInt(localObject3);
          if ((i2 == 0) && (i1 != 0)) {
            break label492;
          }
          if (localObject1[m] != m) {
            paramx.a(localObject3, localObject1[m]);
          }
          localw.f();
        } while (i1 == 0);
      }
      paramab.a(w.a(paramo, paramx));
    }
    label492:
    return j;
  }
  
  public Object a(Object paramObject)
  {
    int i = f.o;
    Object localObject1 = c(paramObject);
    if (i == 0) {
      if (localObject1 == null) {
        throw new IllegalArgumentException("No Id stored for " + paramObject);
      }
    }
    Object localObject2 = this.a.c.get(localObject1);
    if (i == 0) {
      if (localObject2 == null) {
        throw new IllegalArgumentException("No memento information stored for id " + localObject1);
      }
    }
    return localObject2;
  }
  
  final Object b(Object paramObject)
  {
    Object localObject = this.d.get(paramObject);
    if (f.o == 0) {
      if (localObject == null) {
        throw new IllegalArgumentException("No Id stored for " + paramObject);
      }
    }
    return localObject;
  }
  
  final Object c(Object paramObject)
  {
    Object localObject = this.c.get(paramObject);
    if (f.o == 0) {
      if (localObject == null) {
        throw new IllegalArgumentException("No Id stored for " + paramObject);
      }
    }
    return localObject;
  }
  
  public void a(boolean paramBoolean)
  {
    this.e = paramBoolean;
  }
  
  public void d(Object paramObject)
  {
    if (f.o == 0) {
      if (!(paramObject instanceof Map)) {
        throw new IllegalArgumentException("Unknown memento type!");
      }
    }
    Map localMap = (Map)paramObject;
    this.a = ((a_)localMap.get("y.layout.hierarchic.MementoLayerer.LayerMemento"));
  }
  
  public void e(Object paramObject)
  {
    if (f.o == 0) {
      if (!(paramObject instanceof Map)) {
        throw new IllegalArgumentException("Unknown memento type!");
      }
    }
    Map localMap = (Map)paramObject;
    localMap.put("y.layout.hierarchic.MementoLayerer.LayerMemento", this.a);
  }
  
  public void a()
  {
    this.b = null;
    this.a = null;
    this.d = null;
    this.c = null;
  }
  
  static class a_
    implements Serializable
  {
    int a = 0;
    Map c = new HashMap();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.lb

 * JD-Core Version:    0.7.0.1

 */